package spring.cloud.tasks.client.batch_task_processor;

import lombok.Getter;
import lombok.Setter;

import java.util.List;

public class TaskWorkerInstanceServerInfo {
    @Setter
    @Getter
    private String taskId;
    @Setter
    @Getter
    private String taskInstanceId;
    @Setter
    @Getter
    private String taskInstancefo;//普通任务 立即执行 重跑
    //
    @Setter
    @Getter
    private String batchCreaterRun;
    @Setter
    @Getter
    private String batchCreaterRunWorkerId;
    @Setter
    @Getter
    private String batchCreaterRunStatus;
    @Setter
    @Getter
    private String batchCreaterRunParameter;
    //
    @Setter
    @Getter
    private String batchExecuterRun;
    @Setter
    @Getter
    private List<String> batchCreaterRunWorkerIdList;
    @Setter
    @Getter
    private String batchExecuterRunStatus;
    @Setter
    @Getter
    private String batchExecuterRunParameter;
    @Setter
    @Getter
    private int threadExecuteCountPerBatcher;
    //
    @Setter
    @Getter
    private String batchResultCollecterRun;
    @Setter
    @Getter
    private String batchResultCollecterRunWorkerId;
    @Setter
    @Getter
    private String batchResultCollecterRunStatus;
    @Setter
    @Getter
    private String batchResultCollecterRunParameter;

    public boolean needRunOfBatchCreater() {
        return "running".equals(batchCreaterRunStatus);
    }

    public boolean needRunOfBatchExecuter() {
        return "running".equals(batchExecuterRunStatus);
    }

    public boolean needRunOfBatchResultCollecter() {
        return "running".equals(batchResultCollecterRunStatus);
    }
}
